<template>
<el-dialog title="详情"
           :close-on-click-modal="false" append-to-body
           :visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
           width="600px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" >
    <template v-if="!loading">
        <el-col   :span="24" >
        <el-card class="mb-20" shadow ="always"  header ="资产信息">
            <el-col :span="6" >
                <el-form-item  label="资产编号"  
 prop="zcNumber" >
                        <p>{{dataForm.zcNumber}}</p>
                </el-form-item>
            </el-col>
        </el-card>
        </el-col>
        <el-col   :span="24" >
        <el-card class="mb-20" shadow ="always"  header ="经营规划信息">
            <el-col :span="6" >
                <el-form-item  label="运营公司"  
 prop="jnpf_zcgl_jygh_jnpf_operatingCompany" >
                        <p>{{ dataForm.jnpf_zcgl_jygh_jnpf_operatingCompany | dynamicText(operatingCompanyOptions) }} </p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="项目"  
 prop="jnpf_zcgl_jygh_jnpf_project" >
                        <p>{{ dataForm.jnpf_zcgl_jygh_jnpf_project | dynamicText(projectOptions) }} </p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="经营方式"  
 prop="jnpf_zcgl_jygh_jnpf_modeOperation" >
                            <p>{{dataForm.jnpf_zcgl_jygh_jnpf_modeOperation}}</p>
                </el-form-item>
            </el-col>
            <el-col :span="6" >
                <el-form-item  label="业务状态"  
 prop="jnpf_zcgl_jygh_jnpf_businessStatus" >
                        <p>{{ dataForm.jnpf_zcgl_jygh_jnpf_businessStatus | dynamicText(businessStatusOptions) }} </p>
                </el-form-item>
            </el-col>
            <el-col :span="18" >
                <el-form-item  label="备注"  
 prop="jnpf_zcgl_jygh_jnpf_notes" >
                            <p>{{dataForm.jnpf_zcgl_jygh_jnpf_notes}}</p>
                </el-form-item>
            </el-col>
        </el-card>
        </el-col>
    </template>
</el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false"> 取 消</el-button>
    </span>
    </el-dialog>
</template>
<script>
    import request from '@/utils/request'
    import PrintBrowse from '@/components/PrintBrowse'
    import jnpf from '@/utils/jnpf'
    export default {
        components: {PrintBrowse},
        props: [],
        data() {
            return {
                visible: false,
                loading: false,
                printBrowseVisible: false,
                printId: '',
            dataForm: {
                id :'',
                            zcNumber : '',
                    zcgl_jygh:
                    {
                                operatingCompany:'',
                                project:'',
                                modeOperation:'',
                                businessStatus:'',
                                notes:'',
                    },
                    jnpf_zcgl_jygh_jnpf_operatingCompany:'',
                    jnpf_zcgl_jygh_jnpf_project:'',
                    jnpf_zcgl_jygh_jnpf_modeOperation:'',
                    jnpf_zcgl_jygh_jnpf_businessStatus:'',
                    jnpf_zcgl_jygh_jnpf_notes:'',
            },

                                    jnpf_zcgl_jygh_jnpf_operatingCompanyOptions:[{"fullName":"运营公司一","id":"1"},{"fullName":"运营公司二","id":"2"}],
                                    jnpf_zcgl_jygh_jnpf_projectOptions:[{"fullName":"项目一","id":"1"},{"fullName":"项目二","id":"2"}],
                                    jnpf_zcgl_jygh_jnpf_businessStatusOptions:[{"fullName":"业务状态一","id":"1"},{"fullName":"业务状态二","id":"2"}],
        }
        },
        computed: {},
        watch: {},
        created() {

        },
        mounted() {},
        methods: {
            dataInfo(dataAll){
                let _dataAll =dataAll
                        _dataAll.jnpf_zcgl_jygh_jnpf_operatingCompany =  _dataAll.jnpf_zcgl_jygh_jnpf_operatingCompany ? JSON.parse(_dataAll.zcgl_jygh.operatingCompany) :[]
                        _dataAll.jnpf_zcgl_jygh_jnpf_project =  _dataAll.jnpf_zcgl_jygh_jnpf_project ? JSON.parse(_dataAll.zcgl_jygh.project) :[]
                        _dataAll.jnpf_zcgl_jygh_jnpf_modeOperation =  _dataAll.zcgl_jygh.modeOperation
                        _dataAll.jnpf_zcgl_jygh_jnpf_businessStatus =  _dataAll.jnpf_zcgl_jygh_jnpf_businessStatus ? JSON.parse(_dataAll.zcgl_jygh.businessStatus) :[]
                        _dataAll.jnpf_zcgl_jygh_jnpf_notes =  _dataAll.zcgl_jygh.notes
                this.dataForm = _dataAll
            },

            init(id) {
                this.dataForm.id = id || 0;
                this.visible = true;
                this.$nextTick(() => {
                    if(this.dataForm.id){
                        this.loading = true
                        request({
                            url: '/api/example/ZcglZcdjInfoTz/detail/'+this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataInfo(res.data)
                            this.loading = false
                        })
                    }

                })
            },
        },
    }

</script>
